# BEGIN Url Rewrite section
# (Automatically generated.  Do not edit this section)
<IfModule mod_rewrite.c>
RewriteEngine On
# prevent a certain type of hack
# RewriteCond %{QUERY_STRING} http[:%] [NC]


# RewriteRule .* /------------http----------- [F,NC]
# RewriteRule http: /---------http----------- [F,NC]
# Block out any script trying to set a mosConfig value through the URL
# RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
# RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
# RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# ellen added:
# RewriteCond %{QUERY_STRING} UNION [OR]
# RewriteCond %{QUERY_STRING} union [OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
# RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
# RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!

# RewriteRule ^(.*)$ index.php [F,L]
# 
########## End - Rewrite rules to block out some common exploits

#
RewriteBase /art/gallery/
 
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   -   [L]

RewriteCond %{THE_REQUEST} /art/gallery/sitemap(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=sitemap.Sitemap   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/v/([^?]+)/slideshowapplet\.html(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=slideshowapplet.SlideshowApplet&g2_path=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/d/([0-9]+)-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/v/([^?]+)/slideshow\.html(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=slideshow.Slideshow&g2_path=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/c/view/([0-9]+)\.html(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=comment.ShowAllComments&g2_itemId=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/c/add/([0-9]+)\.html(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=comment.AddComment&g2_itemId=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/v/([^?]+)\.davmount(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=webdav.DownloadDavMount&g2_path=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/rss/([^\/\?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=rss.Render&g2_name=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/srss/([0-9]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_view=rss.SimpleRender&g2_itemId=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/w(/[^?]*)?(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_controller=webdav.WebDav&g2_path=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/f/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_controller=permalinks.Redirect&g2_filename=%1   [QSA,L]
RewriteCond %{THE_REQUEST} /art/gallery/([^?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/art/gallery/main\.php$
RewriteRule .   /art/gallery/main.php?g2_path=%1   [QSA,L]
</IfModule>

# END Url Rewrite section
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  Rewritecond %{REQUEST_FILENAME} !gallery_remote2.php
  RewriteRule (.*)$ /art/gallery/main.php?g2_controller=migrate.Redirect&g2_path=$1 [QSA]
</IfModule>
